//
//  AMSearchBar.m
//  AMwb
//
//  Created by zhc on 15/11/29.
//  Copyright © 2015年 zhc. All rights reserved.
//

#import "AMSearchBar.h"

@implementation AMSearchBar

-(id)initWithFrame:(CGRect)frame{

    self=[super initWithFrame:frame];
    
    if(self){
        
        
        self.font=[UIFont systemFontOfSize:13];
        self.placeholder=@"请输入你要搜索的";
        
        self.background=[UIImage imageNamed:@"searchbar_textfield_background"];
      
        // NSString *image=[NSString stringWithFormat:@"searchbar_textfield_search_icon"];
        //放大镜
        UIImageView *searchIcon=[[UIImageView alloc]init];
        searchIcon.image=[UIImage imageNamed:@"searchbar_textfield_search_icon"];
        searchIcon.frame=CGRectMake(0, 0, 30, 30);
        searchIcon.contentMode=UIViewContentModeCenter;
        
        //[searchIcon sizeToFit];
        
        self.leftView=searchIcon;
        self.leftViewMode=UITextFieldViewModeAlways;
 
    
    
    }

 return  self;

}



+ (instancetype)searchBar{


    return [[self alloc]init];

}

@end
